<!doctype html>

<head>

	<!-- Basics -->
	
	<meta charset="utf-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	
	<title>Login</title>

	<!-- CSS -->
	
	<link rel="stylesheet" href="<?php echo PATH?>web/css/login/css/reset.css">
	<link rel="stylesheet" href="<?php echo PATH?>web/css/login/css/animate.css">
	<link rel="stylesheet" href="<?php echo PATH?>web/css/login/css/styles.css">
	<link rel="stylesheet" type="text/css" href="<?php echo PATH?>/web/css/styles.css"/>
	
	<script type="text/javascript" src="<?php echo PATH?>/web/js/jquery-1.10.2.js"></script>
	
</head>

	<!-- Main HTML -->
<script>

	jQuery(document).ready(function () {
 		// MENSAJES
		$(".message").click(function () {
	 		$(this).fadeOut();
	 	});
	 	
	});
</script>	
<body>
	
	<!-- Begin Page Content -->
	<!--wrapper-->
	<div id="wrapper">
		<!--container-->
		<div id="container">
			<?php if(isset($error)) : ?>	
			<div class="message red" id="msjERRORLogin"  style="width: 450px; margin-left: 250px; margin-top: 10px; height: 40px;">
				<span><?php echo 'ERROR: '.$error?></span>
		 	</div>
		 	<?php endif; ?>
			<div id="containerLogin" style="height: 338px; margin-top: -120px;">
				<form name="loginForm" method="post" action="<?php echo PATH?>usuario/ingresar">
					<label for="name">Username:</label>
					<input type="name" name="user" style="margin-bottom: 15px;">
					<label for="name">Tipo de usuario:</label>
					<?php 
					$perfiles = Perfil::listar();
					$perfil = null;
					$idPerfil = null;
					$select = "<select type='name' name='perfil' style='margin-right: 20px; width: 150px;'>\n";
			
					foreach($perfiles as $p) {
			  		 	$s = '';
						if($p->idPerfil != 2){
							$idPerfil = $p->idPerfil;
				   			if($perfil == null){
				   				$perfil = $p->descripcion;
				   				$s = 'selected';
				   			}
				   			$select .= "<option value='$idPerfil' $s>$p->descripcion</option>\n";
						}
					}
					echo $select . "</select>"
					?>
					<label for="username">Password:</label>
					<!-- <p><a href="#">Forgot your password?</a> -->
					<input type="password" name="password"/>
					<div id="lower">
					<!-- <input type="checkbox"><label class="check" for="checkbox">Keep me logged in</label> -->
						<input type="submit" value="Login" style="margin-top: 15px; margin-right: 15px;"/>
					</div>
				</form>
			</div>
			<!-- End Page Content -->
		</div>
	</div>
</body>
</html>
	
	
	
	
	
		
	